-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: ganache migration base setup #27246
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #27246 +/- ##
===========================================
+ Coverage 70.00% 70.02% +0.02%
===========================================
Files 1445 1443 -2
Lines 50195 50165 -30
Branches 14041 14041
===========================================
- Hits 35139 35127 -12
+ Misses 15056 15038 -18 ☔ View full report in Codecov by Sentry. |
Builds ready [38b4b80]
Page Load Metrics (1636 ± 45 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -1,4 +1,4 @@ | |||
import GanacheContractAddressRegistry from '../seeder/ganache-contract-address-registry'; | |||
import ContractAddressRegistry from '../seeder/contract-address-registry'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a rename, as now it's used both with ganache and anvil - no functionality change
*/ | ||
class GanacheContractAddressRegistry { | ||
class ContractAddressRegistry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a rename, as now it's used both with ganache and anvil - no functionality change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change already merged on a separate PR, to make this one smaller
test/e2e/seeder/ganache-seeder.js
Outdated
@@ -3,14 +3,14 @@ const { ContractFactory, Contract } = require('@ethersproject/contracts'); | |||
|
|||
const { ENTRYPOINT, GANACHE_ACCOUNT } = require('../constants'); | |||
const { SMART_CONTRACTS, contractConfiguration } = require('./smart-contracts'); | |||
const GanacheContractAddressRegistry = require('./ganache-contract-address-registry'); | |||
const ContractAddressRegistry = require('./contract-address-registry'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a rename, as now it's used both with ganache and anvil - no functionality change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change already merged on a separate PR, to make this one smaller
|
||
return { publicClient, testClient, walletClient }; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file will be expanded in the future, for when we want to add Optimism clients for L2 network support. See:
@@ -0,0 +1,149 @@ | |||
const { DEFAULT_FIXTURE_ACCOUNT, ENTRYPOINT } = require('../constants'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file supports the same functionality as ganache seeder, but adapted to viem (meaning using publicClient/walletClient/testClient for the different actions), so we are able to expand to L2's in the future with L2 clients
mnemonic: | ||
'spread raise short crane omit tent fringe mandate neglect detail suspect cradle', | ||
port: 8545, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are the default network options. Since we have them defined here, there's no need for defaultAnvilOptions
, so we don't need to pass anything in the spec files, when we want the default options (see spec files above).
Likewise, we have ganache options defined in the ganache file, we wouldn't need the defaultGanacheOptions
(but it's implemented like this)
await this.#server.stop(); | ||
} catch (e) { | ||
console.log('Caught error while closing Anvil network:', e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the same methods that we support on ganache, so functionality is preserved
Builds ready [27e4895]
Page Load Metrics (1978 ± 69 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [66c17fb]
Page Load Metrics (1992 ± 107 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
This reverts commit 51b384e.
Builds ready [ac507d6]
Page Load Metrics (1795 ± 105 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Description
Ganache Migration Phase:
GanacheContractAddressRegistry
class in preparation for ganache migration #28595Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3321
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist